feat(android): expose call delivery mode (Telecom vs standalone) to Flutter#310
Merged
Merged
Conversation
…lutter Devices without android.software.telecom fall back from the Telecom ConnectionService path to a limited StandaloneCallService. That state was detected natively (TelephonyUtils.isTelecomSupported / CallServiceRouter) but never surfaced to Flutter, so the app could not tell the user their device runs in the restricted standalone mode. Add a PHostPermissionsApi.getCallDeliveryMode() getter returning a new CallkeepAndroidCallDeliveryMode enum (telecom / standalone / unknown), wired through every layer: pigeon definition, Kotlin host implementation (reuses the same isTelecomSupported gate the router uses), the android platform plugin and converter, the platform interface model, and the public WebtritCallkeepPermissions API. Non-Android platforms return unknown. This is distinct from the existing battery-optimization warning; it is the prerequisite for warning the user about limited call delivery on devices without Telecom.
Address review feedback: - webtrit_callkeep_web now overrides getCallDeliveryMode() to return CallkeepAndroidCallDeliveryMode.unknown, mirroring the existing getBatteryMode default so the web platform impl does not fall through to the throwing platform-interface default. - Replace the broken dartdoc reference [ConnectionService] with a code-formatted android.telecom.ConnectionService to avoid a broken doc link.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
On devices without
android.software.telecom(many tablets, Android Go, some OEM/ChromeOS) the plugin falls back from the TelecomConnectionServicepath to the limitedStandaloneCallService. That state was detected natively (TelephonyUtils.isTelecomSupported/CallServiceRouter) but never surfaced to Flutter, so the app cannot tell the user their device runs in the restricted standalone mode.This adds a getter that exposes the active call-delivery mode to Flutter. It is the callkeep half of WT-1195; the webtrit_phone half (warning the user) builds on it.
Changes
PHostPermissionsApi.getCallDeliveryMode()in the pigeon definition, returning a newCallkeepAndroidCallDeliveryModeenum (telecom/standalone/unknown).PermissionsApireuses the sameTelephonyUtils.isTelecomSupported(context)gate the router uses, so the reported value matches the actually active delivery path.WebtritCallkeepPermissionsAPI. Non-Android platforms returnunknown.Notes
batteryOptimizationWarning(socket mode + battery exemption).callkeep.pigeon.dart,Generated.kt) were edited additively for this one getter; a full pigeon regeneration was intentionally avoided because the committedGenerated.ktondevelopis already stale relative to its pigeon source (the logging refactor removedPLogTypeEnum/PDelegateLogsFlutterApifrom the source whileLog.kt/WebtritCallkeepPlugin.ktstill reference them), so a wholesale regen would drop symbols the Kotlin still needs and break the build. Worth a separate cleanup.Test plan
flutter analyzeclean across all packagesflutter test(webtrit_callkeep_android) - all pass, incl. new converter + API tests./gradlew testDebugUnitTest(Kotlin) - compiles and passes